package com.niodata.dp.monitor.sharelib.entity.base;

/**
 * Created by ndp on 17-12-19.
 */
public class DefaultSetting {

  public static final long mbLength = 1048576L;
  public static final long gbLength = 1073741824L;
  public static final long tbLength = 1099511627776L;

  public static final String jmxServerUrlFormat = "%s/jmx?qry=%s";
  public static final String hbaseRegionJmxUrlFormat = "http://%s:%s/jmx?qry=%s";
  public static final String nameNodeInfo = "Hadoop:service=NameNode,name=NameNodeInfo";
  public static final String fsNameSystem = "Hadoop:service=NameNode,name=FSNamesystem";
  public static final String fsNameSystemState = "Hadoop:service=NameNode,"
        + "name=FSNamesystemState";
  public static final String rpcActivityForPort9000 = "Hadoop:service=NameNode,"
        + "name=RpcActivityForPort9000";
  public static final String hadoopJvmMetrics = "Hadoop:service=NameNode,name=JvmMetrics";
  public static final String rpcDetailedActivityForPort9000 = "Hadoop:service=NameNode,"
        + "name=RpcDetailedActivityForPort9000";
  public static final String clusterMetrics = "Hadoop:service=ResourceManager,name=ClusterMetrics";
  public static final String queueMetrics = "Hadoop:service=ResourceManager,"
        + "name=QueueMetrics,q0=root";
  public static final String rpcDetailedActivityForPort8032 = "Hadoop:service=ResourceManager,"
        + "name=RpcDetailedActivityForPort8032";
  public static final String masterServer = "Hadoop:service=HBase,name=Master,sub=Server";
  public static final String regionServer = "Hadoop:service=HBase,name=RegionServer,sub=Server";
  public static final String regionIpc = "Hadoop:service=HBase,name=RegionServer,sub=IPC";

  public static final String getAllPrestoNodes = "SELECT * FROM system.runtime.nodes";
  public static final String get10QueriesLastQ = "SELECT * FROM system.runtime.queries"
        + " order by created desc limit 20";
  public static final String getPrestoThreadCount = "select threadcount from"
        + " jmx.current.\"java.lang:type=Threading\"";
  public static final String getNodeStateCount = "select activecount,failedcount,totalcount "
        + "from jmx.current.\"com.facebook.presto.failureDetector:name=HeartbeatFailureDetector\"";
  public static final String getPrestoStatus = "select runningqueries,"
        + "\"failedqueries.fiveminute.count\",\"internalfailures.fiveminute.count\","
        + "\"externalfailures.fiveminute.count\",\"usererrorfailures.fiveminute.count\","
        + "\"startedqueries.fiveminute.count\",\"executiontime.fiveminutes.p50\""
        + " from jmx.current.\"com.facebook.presto.execution:name=QueryManager\"";
}
